# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mxtract
pkgver=90.0b34376
pkgrel=1
pkgdesc='Memory Extractor & Analyzer.'
groups=('blackarch' 'blackarch-forensic')
arch=('any')
url='https://github.com/rek7/mXtract'
license=('MIT')
makedepends=('gcc' 'git')
source=("$pkgname::git+https://github.com/rek7/mXtract.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  g++ -std=c++11 -O2 src/main.cpp -o $pkgname
}

package() {
  cd $pkgname

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md \
    example_regexes.db
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
}

